<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/doc/src/qtdesigner.qdoc -->
<head>
  <title>Qt 4.3: QtDesigner Module</title>
  <link rel="prev" href="qtxml.html" />
  <link rel="contents" href="modules.html" />
  <link rel="next" href="qtuitools.html" />
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><p>
[Previous: <a href="qtxml.html">QtXml Module</a>]
[<a href="modules.html">Qt's Modules</a>]
[Next: <a href="qtuitools.html">QtUiTools Module</a>]
</p>
<h1 align="center">QtDesigner Module<br /><small></small></h1>
<p>The QtDesigner module provides classes that allow you to create your own custom widget plugins for Qt Designer, and classes that enable you to access Qt Designer's components. <a href="#details">More...</a></p>
<h2>Classes</h2>
<p><table width="100%" class="annotated" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><th><a href="qabstractextensionfactory.html">QAbstractExtensionFactory</a></th><td>Interface for extension factories in Qt Designer</td></tr>
<tr valign="top" class="even"><th><a href="qabstractextensionmanager.html">QAbstractExtensionManager</a></th><td>Interface for extension managers in Qt Designer</td></tr>
<tr valign="top" class="odd"><th><a href="qabstractformbuilder.html">QAbstractFormBuilder</a></th><td>Default implementation for classes that create user interfaces at run-time</td></tr>
<tr valign="top" class="even"><th><a href="qdesigneractioneditorinterface.html">QDesignerActionEditorInterface</a></th><td>Allows you to change the focus of Qt Designer's action editor</td></tr>
<tr valign="top" class="odd"><th><a href="qdesignercontainerextension.html">QDesignerContainerExtension</a></th><td>Allows you to add pages to a custom multi-page container in Qt Designer's workspace</td></tr>
<tr valign="top" class="even"><th><a href="qdesignercustomwidgetcollectioninterface.html">QDesignerCustomWidgetCollectionInterface</a></th><td>Allows you to include several custom widgets in one single library</td></tr>
<tr valign="top" class="odd"><th><a href="qdesignercustomwidgetinterface.html">QDesignerCustomWidgetInterface</a></th><td>Enables Qt Designer to access and construct custom widgets</td></tr>
<tr valign="top" class="even"><th><a href="qdesignerdynamicpropertysheetextension.html">QDesignerDynamicPropertySheetExtension</a></th><td>Allows you to manipulate a widget's dynamic properties in Qt Designer's property editor</td></tr>
<tr valign="top" class="odd"><th><a href="qdesignerformeditorinterface.html">QDesignerFormEditorInterface</a></th><td>Allows you to access Qt Designer's various components</td></tr>
<tr valign="top" class="even"><th><a href="qdesignerformwindowcursorinterface.html">QDesignerFormWindowCursorInterface</a></th><td>Allows you to query and modify a form window's widget selection, and in addition modify the properties of all the form's widgets</td></tr>
<tr valign="top" class="odd"><th><a href="qdesignerformwindowinterface.html">QDesignerFormWindowInterface</a></th><td>Allows you to query and manipulate form windows appearing in Qt Designer's workspace</td></tr>
<tr valign="top" class="even"><th><a href="qdesignerformwindowmanagerinterface.html">QDesignerFormWindowManagerInterface</a></th><td>Allows you to manipulate the collection of form windows in Qt Designer, and control Qt Designer's form editing actions</td></tr>
<tr valign="top" class="odd"><th><a href="qdesignermembersheetextension.html">QDesignerMemberSheetExtension</a></th><td>Allows you to manipulate a widget's member functions which is displayed when configuring connections using Qt Designer's mode for editing signals and slots</td></tr>
<tr valign="top" class="even"><th><a href="qdesignerobjectinspectorinterface.html">QDesignerObjectInspectorInterface</a></th><td>Allows you to change the focus of Qt Designer's object inspector</td></tr>
<tr valign="top" class="odd"><th><a href="qdesignerpropertyeditorinterface.html">QDesignerPropertyEditorInterface</a></th><td>Allows you to query and manipulate the current state of Qt Designer's property editor</td></tr>
<tr valign="top" class="even"><th><a href="qdesignerpropertysheetextension.html">QDesignerPropertySheetExtension</a></th><td>Allows you to manipulate a widget's properties which is displayed in Qt Designer's property editor</td></tr>
<tr valign="top" class="odd"><th><a href="qdesignertaskmenuextension.html">QDesignerTaskMenuExtension</a></th><td>Allows you to add custom menu entries to Qt Designer's task menu</td></tr>
<tr valign="top" class="even"><th><a href="qdesignerwidgetboxinterface.html">QDesignerWidgetBoxInterface</a></th><td>Allows you to control the contents of Qt Designer's widget box</td></tr>
<tr valign="top" class="odd"><th><a href="qextensionfactory.html">QExtensionFactory</a></th><td>Allows you to create a factory that is able to make instances of custom extensions in Qt Designer</td></tr>
<tr valign="top" class="even"><th><a href="qextensionmanager.html">QExtensionManager</a></th><td>Extension management facilities for Qt Designer</td></tr>
<tr valign="top" class="odd"><th><a href="qformbuilder.html">QFormBuilder</a></th><td>Used to dynamically construct user interfaces from .ui files at run-time</td></tr>
</table></p>
<a name="details"></a>
<h2>Detailed Description</h2>
<p>In addition, the <a href="qformbuilder.html">QFormBuilder</a> class provides the possibility of constructing user interfaces from <tt>.ui</tt> files at run-time.</p>
<p>To include the definitions of the module's classes, use the following directive:</p>
<pre> #include &lt;QtDesigner&gt;</pre>
<p>To link against the module, add this line to your <tt>qmake</tt> .pro file:</p>
<pre> CONFIG += designer</pre>
<ul><li><a href="#creating-custom-widget-plugins">Creating Custom Widget Plugins</a></li>
<li><a href="#retrieving-access-to-qt-designer-components">Retrieving Access to <i>Qt Designer</i> Components</a></li>
<li><a href="#creating-user-interfaces-at-run-time">Creating User Interfaces at Run-Time</a></li>
</ul>
<a name="creating-custom-widget-plugins"></a>
<h3>Creating Custom Widget Plugins</h3>
<p>When implementing a custom widget plugin for <i>Qt Designer</i>, you must subclass <a href="qdesignercustomwidgetinterface.html">QDesignerCustomWidgetInterface</a> to expose your custom widget to <i>Qt Designer</i>. A single custom widget plugin is build as a separate library. If you want to include several custom widget plugins in the same library, you must in addition subclass <a href="qdesignercustomwidgetcollectioninterface.html">QDesignerCustomWidgetCollectionInterface</a>.</p>
<p>To provide your custom widget plugin with the expected behavior and functionality within <i>Qt Designer</i>'s workspace you can subclass the associated extension classes:</p>
<p>The <a href="qdesignercontainerextension.html">QDesignerContainerExtension</a> class allows you to add pages to a custom multi-page container. The <a href="qdesignertaskmenuextension.html">QDesignerTaskMenuExtension</a> class allows you to add custom menu entries to <i>Qt Designer</i>'s task menu. The <a href="qdesignermembersheetextension.html">QDesignerMemberSheetExtension</a> class allows you to manipulate a widget's member functions which is displayed when configuring connections using <i>Qt Designer</i>'s mode for editing signals and slots. And finally, the <a href="qdesignerpropertysheetextension.html">QDesignerPropertySheetExtension</a> class allows you to manipulate a widget's properties which is displayed in <i>Qt Designer</i>'s property editor.</p>
<p align="center"><img src="images/qtdesignerextensions.png" /></p><p>In <i>Qt Designer</i> the extensions are not created until they are required. For that reason, when implementing extensions, you must also subclass <a href="qextensionfactory.html">QExtensionFactory</a>, i.e create a class that is able to make instances of your extensions. In addition, you must make <i>Qt Designer</i>'s extension manager register your factory; the extension manager controls the construction of extensions as they are required, and you can access it through <a href="qdesignerformeditorinterface.html">QDesignerFormEditorInterface</a> and <a href="qextensionmanager.html">QExtensionManager</a>.</p>
<p>For a complete example creating a custom widget plugin with an extension, see the <a href="designer-taskmenuextension.html">Task Menu Extension</a> or <a href="designer-containerextension.html">Container Extension</a> examples.</p>
<a name="retrieving-access-to-qt-designer-components"></a>
<h3>Retrieving Access to <i>Qt Designer</i> Components</h3>
<p>The purpose of the classes mentioned in this section is to provide access to <i>Qt Designer</i>'s components, managers and workspace, and they are not intended to be instantiated directly.</p>
<p><i>Qt Designer</i> is composed by several components. It has an action editor, a property editor, widget box and object inspector which you can view in its workspace.</p>
<p align="center"><img src="images/qtdesignerscreenshot.png" /></p><p><i>Qt Designer</i> also has an object that works behind the scene; it contains the logic that integrates all of <i>Qt Designer</i>'s components into a coherent application. You can access this object, using the <a href="qdesignerformeditorinterface.html">QDesignerFormEditorInterface</a>, to retrieve interfaces to <i>Qt Designer</i>'s components:</p>
<ul>
<li><a href="qdesigneractioneditorinterface.html">QDesignerActionEditorInterface</a></li>
<li><a href="qdesignerobjectinspectorinterface.html">QDesignerObjectInspectorInterface</a></li>
<li><a href="qdesignerpropertyeditorinterface.html">QDesignerPropertyEditorInterface</a></li>
<li><a href="qdesignerwidgetboxinterface.html">QDesignerWidgetBoxInterface</a></li>
</ul>
<p>In addition, you can use <a href="qdesignerformeditorinterface.html">QDesignerFormEditorInterface</a> to retrieve interfaces to <i>Qt Designer</i>'s extension manager (<a href="qextensionmanager.html">QExtensionManager</a>) and form window manager (<a href="qdesignerformwindowmanagerinterface.html">QDesignerFormWindowManagerInterface</a>). The extension manager controls the construction of extensions as they are required, while the form window manager controls the form windows appearing in <i>Qt Designer</i>'s workspace.</p>
<p>Once you have an interface to <i>Qt Designer</i>'s form window manager (<a href="qdesignerformwindowmanagerinterface.html">QDesignerFormWindowManagerInterface</a>), you also have access to all the form windows currently appearing in <i>Qt Designer</i>'s workspace: The <a href="qdesignerformwindowinterface.html">QDesignerFormWindowInterface</a> class allows you to query and manipulate the form windows, and it provides an interface to the form windows' cursors. <a href="qdesignerformwindowcursorinterface.html">QDesignerFormWindowCursorInterface</a> is a convenience class allowing you to query and modify a given form window's widget selection, and in addition modify the properties of all the form's widgets.</p>
<a name="creating-user-interfaces-at-run-time"></a>
<h3>Creating User Interfaces at Run-Time</h3>
<p>The <tt>QtDesigner</tt> module contains the <a href="qformbuilder.html">QFormBuilder</a> class that provides a mechanism for dynamically creating user interfaces at run-time, based on <tt>.ui</tt> files created with <i>Qt Designer</i>. This class is typically used by custom components and applications that embed <i>Qt Designer</i>. Standalone applications that need to dynamically generate user interfaces at run-time use the <a href="quiloader.html">QUiLoader</a> class, found in the <a href="qtuitools.html">QtUiTools</a> module.</p>
<p>For a complete example using <a href="quiloader.html">QUiLoader</a>, see the <a href="designer-calculatorbuilder.html">Calculator Builder example</a>.</p>
<p>See also <a href="designer-manual.html">Qt Designer Manual</a> and <a href="qtuitools.html">QtUiTools Module</a>.</p>
<p>
[Previous: <a href="qtxml.html">QtXml Module</a>]
[<a href="modules.html">Qt's Modules</a>]
[Next: <a href="qtuitools.html">QtUiTools Module</a>]
</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
